const fs = require('fs');
const alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
const Alphabet=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','o','p','Q','r','s','t','u','v','w','x','Y','z'];
const number=['1','2','3','4','5','6','7','8','9','0'];
const char=[',','.','。','，','+','-','*'];
const len=8;
const a_A_n=[...alphabet,...Alphabet,...number];
const a_A_n_c=[...alphabet,...Alphabet,...number,...char];

function generateCombinations(arr, k, prefix = '') {
  if (prefix.length === k) {
    fs.appendFileSync('password.txt', prefix + '\n'); // 将结果追加写入a.txt文件
    return;
  }

  for (let i = 0; i < arr.length; i++) {
    generateCombinations(arr, k, prefix + arr[i]);
  }
}

// 

// generateCombinations(a_A_n, len);
function ceshi(){
  let arr=[1,2,2,4,5,3,6,45,8]
  let m=7
  console.log(arr[m/2]);
}
ceshi();